package top.roud.dao.utils;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Properties;

public class GetPropertiesUtils {
	public static String getResult(String filePath,String param) throws Exception {
		Properties prop = null;
		FileReader fr = null;
		BufferedReader br = null;
		String sql = null;
		try {
			prop = new Properties();
			InputStream in = GetPropertiesUtils.class.getClassLoader().getResourceAsStream(filePath);
			Reader r = new InputStreamReader(in);
			br = new BufferedReader(r);
			prop.load(br);
			sql = prop.getProperty(param);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			if(fr!=null) {
				fr.close();
			}
			if(br!=null) {
				br.close();
			}
		}
		return sql;
		
	}
}
